package ie.dkit.java3Demulation.drawer;

import java.awt.Graphics;

public abstract class Drawer {

	/**
	 * The graphics the drawer will draw on
	 */
	protected Graphics m_Graphics;

	/**
	 * The middle of the Coordinate System
	 */
	protected int x_middle, y_middle;

	public Drawer(Graphics graphics, int xMiddle, int ymiddle) {
		x_middle = xMiddle;
		y_middle = ymiddle;
		m_Graphics = graphics;
	}

	public void setGraphics(Graphics graphics, int xMiddle, int ymiddle) {
		x_middle = xMiddle;
		y_middle = ymiddle;
		m_Graphics = graphics;
	}

	protected void writePixel(int x, int y) {
		// y will be inverted that +y is on top on -y on the bottom
		m_Graphics.drawRect(x_middle + x, y_middle + -y, 1, 1);
	}
}
